package com.leyou.item.service;

import com.leyou.item.dto.CategoryDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: wangzibeng
 * Date: 2019/4/28 0028
 * Time: 12:48
 */

public interface CategoryService {

    /**
     * 根据父ID查询对应的类目集合
     *
     * @param pid
     * @return
     */
    List<CategoryDTO> queryCategoryByPid(Long pid);

    /**
     * 新增节点
     *
     * @param name
     * @param parentId
     * @param isParent
     * @param sort
     * @return
     */
    @Transactional
    Long addCategory(String name, Long parentId, Boolean isParent, Integer sort);

}
